<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>HUI 用户注册</title>
    <link rel="stylesheet" type="text/css" href="./css/hui.css" />
</head>
<body>
<style>
    body{
        background:#FFFFFF;
    }
    .hui-input{
        width: 100% !important;
        border-radius: 24px;
        border: 1px solid rgba(217,217,217,1);
        height: 40px;
        line-height: 40px;
        padding-left: 52px;
        box-sizing: border-box;
    }
    .head{
        width: 100%;
        height: 64px;
        background: #2439A5;
    }
    .bg{
        width: 100%;
        height:236px;
        background: url(./img/login_BG.png) no-repeat;
        background-size: 100% 100%;
        margin-top: -2px;
    }
    .check{
        padding: 0px 40px;
        margin-top: 40px;
    }
    .hui-primary{
        background: #2439A5 !important;
        border-radius: 24px;
        font-size: 18px;
        height: 47px;
        line-height: 47px;
        text-align: center;
    }
</style>
<div class="hui-wrap">
    <div class="head"></div>
    <div class="bg"></div>
    <div class="check">
        <div style="position: relative">
            <img src="./img/NUB.png" alt="" style="width: 18px;height: 18px;position: absolute;left: 22px;
                top: 50%;
                margin-top: -20px;">
            <input id="uasername" type="text" class="hui-input hui-input-clear" style="margin-bottom: 24px;" placeholder="请输入电话号码" checkType="string" checkData="5,20" checkMsg="用户名应为5-20个字符" />
        </div>
        <div style="position: relative">
            <img src="./img/LOC.png" alt="" style="width: 14px;height: 18px;position: absolute;left: 22px;
            top: 50%;
            margin-top: -9px;">
            <input id="password" type="password" class="hui-input hui-pwd-eye" placeholder="请输入密码" checkType="string" id="pwd" checkData="6,20" checkMsg="密码应为6-20个字符" />
        </div>
    </div>
    <div style="padding:0px 40px;margin-top: 32px;">
        <button type="button" class="hui-button hui-button-large hui-primary" id="submit">立即登录</button>
    </div>
    <!-- <div style="margin:20px 10px; margin-bottom:15px;" class="hui-form" id="form1">
        <div class="hui-form-items">
           <div class="hui-form-items-title">账号</div>
            <input id="uasername" type="text" class="hui-input hui-input-clear" placeholder="请输入账号" checkType="string" checkData="5,20" checkMsg="用户名应为5-20个字符" />
        </div>
        <div class="hui-form-items">
           <div class="hui-form-items-title">密码</div>
            <input id="password" type="password" class="hui-input hui-pwd-eye" placeholder="请输入密码" checkType="string" id="pwd" checkData="6,20" checkMsg="密码应为6-20个字符" />
        </div>
    </div> -->

</div>
<script type="text/javascript" src="./js/hui.js" charset="UTF-8"></script>
<script type="text/javascript" src="./js/hui-form.js" charset="utf-8"></script>
<script type="text/javascript">

  function gotoIsLogin (phone) {
    nativeMethod.shareData(phone);
  }

//  记录账号密码
    hui.ready(function(){
        if(localStorage.getItem("uasername") != null){
            hui('#uasername').val(localStorage.getItem("uasername"));
        }
  	    if(!localStorage.getItem("password") != null){
            hui('#password').val(localStorage.getItem("password"));
        }
  	});


//  登录事件
hui('#submit').click(function(){

    //验证
    var res = huiFormCheck('#form1');

    if(res){
        localStorage.setItem("uasername",hui('#uasername').val());
        localStorage.setItem("password",hui('#password').val());

        hui.loading('登录中');
        setTimeout(function(){hui.loading(false, true);}, 500);

        setTimeout("login();",1000);
    }

});


// 校验账号密码
function login(){

if(hui('#uasername').val() == "15500000000") {
<!--账号1-->
    if(hui('#uasername').val() == "15500000000" && hui('#password').val() == "15500000000"){
        localStorage.setItem("nowLogin",hui('#uasername').val());
        if(localStorage.getItem("15500000000") !=null && localStorage.getItem("15500000000") !="null"){
         if(localStorage.getItem("15500000000") == "15500000000"){
                gotoIsLogin("15500000000");
            } else {
                localStorage.setItem("15500000000","15500000000");
                hui.open('2.html');
            }
        } else {
            localStorage.setItem("15500000000","15500000000");
            hui.open('2.html');
        }

    } else{
        hui.upToast('账号密码错误!');
    }
} else if(hui('#uasername').val() == "16600000000") {
<!--账号1-->
    if(hui('#uasername').val() == "16600000000" && hui('#password').val() == "16600000000"){
    localStorage.setItem("nowLogin",hui('#uasername').val());
        if(localStorage.getItem("16600000000") !=null && localStorage.getItem("16600000000") !="null"){
           if(localStorage.getItem("16600000000") == "16600000000"){
                gotoIsLogin("16600000000");
            } else {
                localStorage.setItem("16600000000","16600000000");
                hui.open('2.html');
            }
        } else {
            localStorage.setItem("16600000000","16600000000");
            hui.open('2.html');
        }

    } else{
        hui.upToast('账号密码错误!');
    }

} else if(hui('#uasername').val() == "17700000000") {
<!--账号1-->
    if(hui('#uasername').val() == "17700000000" && hui('#password').val() == "17700000000"){
        localStorage.setItem("nowLogin",hui('#uasername').val());
        if(localStorage.getItem("17700000000") !=null && localStorage.getItem("17700000000") !="null"){
            if(localStorage.getItem("17700000000") == "17700000000"){
                gotoIsLogin("17700000000");
            } else {
                localStorage.setItem("17700000000","17700000000");
                hui.open('2.html');
            }
        } else {
            localStorage.setItem("17700000000","17700000000");
            hui.open('2.html');
        }

    } else{
        hui.upToast('账号密码错误!');
    }

} else if(hui('#uasername').val() == "18800000000") {
<!--账号1-->
    if(hui('#uasername').val() == "18800000000" && hui('#password').val() == "18800000000"){
        localStorage.setItem("nowLogin",hui('#uasername').val());
        if(localStorage.getItem("18800000000") !=null && localStorage.getItem("18800000000") !="null"){
            if(localStorage.getItem("18800000000") == "18800000000"){
             if(localStorage.getItem("18800000000") == "18800000000"){
                gotoIsLogin("18800000000");
            } else {
                localStorage.setItem("18800000000","18800000000");
                hui.open('2.html');
            }
            } else {
                localStorage.setItem("18800000000","18800000000");
                hui.open('2.html');
            }

        } else {
            localStorage.setItem("18800000000","18800000000");
            hui.open('2.html');
        }

    } else{
        hui.upToast('账号密码错误!');
    }
} else if(hui('#uasername').val() == "19900000000") {
<!--账号1-->
    if(hui('#uasername').val() == "19900000000" && hui('#password').val() == "19900000000"){
        localStorage.setItem("nowLogin",hui('#uasername').val());
        if(localStorage.getItem("19900000000") !=null && localStorage.getItem("19900000000") !="null"){
            if(localStorage.getItem("19900000000") == "19900000000"){
                gotoIsLogin("19900000000");
            } else {
                localStorage.setItem("19900000000","19900000000");
                hui.open('2.html');
            }
        } else {
            localStorage.setItem("19900000000","19900000000");
            hui.open('2.html');
        }

    } else{
        hui.upToast('账号密码错误!');
    }
}

}
</script>
</body>

</html>